package com.longai.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections.map.HashedMap;
import org.springframework.stereotype.Repository;

import util.Page;

import com.longai.model.*;
@Repository
public class MomentCommentDAO extends BaseDAO {
	public void save(MomentComment comment){
		super.saveOrUpdate(comment);
	}
	public void delete(MomentComment comment){
		super.delete(comment);
	}
	public MomentComment findById(int id){
		return (MomentComment)super.findById(id, MomentComment.class);
	}
	public List<MomentComment> findAll(){
		Map<String, Object>map=null;
		String queryStr="from Momentcomment";
		return super.queryAll(queryStr, map);
	}
    public Page findByMomentId(String str,String currentPage,String amount) {
    	Map<String, Object> map = null;
		String queryStr = "from MomentComment where moment_id='"+str+"'";
		return super.queryByPage(queryStr, map, currentPage, amount);
	}
    public MomentComment findByMomentCommentId(String str) {
    	Map<String, Object> map = new HashMap<String, Object>();
		String queryStr = "from Momentcomment as a where a.momentcomment_id=:aid";
		map.put("aid", str);
		return (MomentComment)super.queryIdentity(queryStr, map);
    }
}